package com.boscloud.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    private String code;
    private String msg;
    private String data;
    private String plant;
    private String firstName;
    private String lastName;
    private String versionNo;
    private String erpId;

    public static Result success(String jwt,String plant,String firstName,String erpId){
        Result res = new Result();
        res.setCode("200");
        res.setData(jwt);
        res.setPlant(plant);
        res.setFirstName(firstName);
        res.setErpId(erpId);
        return res;
    }
    public static Result error(String code,String msg){
        Result res = new Result();

        if( code != null){
            res.setCode(code);
        }else{
            res.setCode("500");
        }
        res.setMsg(msg);
        return res;
    }

}
